package com.luoxiang.socialandroid.adapter

import android.widget.TextView
import androidx.core.content.ContextCompat
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.luoxiang.socialandroid.R
import com.luoxiang.socialandroid.bean.SendMessageBean

/**
 * Author: Sakura

 * Date: 2023/4/18

 * Description:
 */
class VideoChatAdapter :
    BaseQuickAdapter<SendMessageBean, BaseViewHolder>(R.layout.item_video_chat, mutableListOf()) {

    override fun convert(holder: BaseViewHolder, item: SendMessageBean) {
        if (item.isViolations){
            holder.getView<TextView>(R.id.content).setTextColor(ContextCompat.getColor(holder.itemView.context,R.color.list_dialog_hint))
        }else{
            holder.getView<TextView>(R.id.content).setTextColor(ContextCompat.getColor(holder.itemView.context,R.color.white))
        }
        holder.getView<TextView>(R.id.content).text = "${item.userName}:${item.content}"
    }
}